load("@rules_java//java:defs.bzl", "java_library")

package(
    default_applicable_licenses = ["//:license"],
    default_visibility = [
        "//bundle:__pkg__",
        "//publish:__pkg__",
    ],
)

CEL_SOURCES = [
    "Cel.java",
    "CelBuilder.java",
    "CelFactory.java",
    "CelImpl.java",
]

java_library(
    name = "cel",
    srcs = CEL_SOURCES,
    tags = [
    ],
    deps = [
        "//checker",
        "//checker:checker_builder",
        "//checker:checker_legacy_environment",
        "//checker:proto_type_mask",
        "//common:cel_ast",
        "//common:cel_source",
        "//common:compiler_common",
        "//common:container",
        "//common:options",
        "//common/internal:env_visitor",
        "//common/internal:file_descriptor_converter",
        "//common/types:cel_proto_types",
        "//common/types:type_providers",
        "//common/values:cel_value_provider",
        "//compiler",
        "//compiler:compiler_builder",
        "//parser",
        "//parser:macro",
        "//parser:parser_builder",
        "//runtime",
        "//runtime:function_binding",
        "@cel_spec//proto/cel/expr:checked_java_proto",
        "@maven//:com_google_code_findbugs_annotations",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
        "@maven//:com_google_protobuf_protobuf_java",
    ],
)

java_library(
    name = "environment",
    srcs = [
        "CelEnvironment.java",
    ],
    tags = [
    ],
    deps = [
        ":environment_exception",
        ":required_fields_checker",
        "//:auto_value",
        "//bundle:cel",
        "//checker:standard_decl",
        "//common:compiler_common",
        "//common:container",
        "//common:options",
        "//common:source",
        "//common/types",
        "//common/types:type_providers",
        "//compiler:compiler_builder",
        "//extensions",
        "//extensions:optional_library",
        "//parser:macro",
        "//runtime",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
    ],
)

java_library(
    name = "environment_exception",
    srcs = [
        "CelEnvironmentException.java",
    ],
    tags = [
    ],
    deps = ["//common:cel_exception"],
)

java_library(
    name = "environment_yaml_parser",
    srcs = [
        "CelEnvironmentYamlParser.java",
        "CelEnvironmentYamlSerializer.java",
    ],
    tags = [
    ],
    deps = [
        ":environment",
        ":environment_exception",
        "//common:compiler_common",
        "//common/formats:file_source",
        "//common/formats:parser_context",
        "//common/formats:yaml_helper",
        "//common/formats:yaml_parser_context_impl",
        "//common/internal",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
        "@maven//:org_jspecify_jspecify",
        "@maven//:org_yaml_snakeyaml",
    ],
)

java_library(
    name = "environment_exporter",
    srcs = [
        "CelEnvironmentExporter.java",
    ],
    tags = [
    ],
    deps = [
        ":environment",
        "//:auto_value",
        "//bundle:cel",
        "//checker:standard_decl",
        "//common:compiler_common",
        "//common:options",
        "//common/internal:env_visitor",
        "//common/types:cel_proto_types",
        "//common/types:cel_types",
        "//common/types:type_providers",
        "//extensions",
        "//extensions:extension_library",
        "//parser:macro",
        "@cel_spec//proto/cel/expr:checked_java_proto",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_guava_guava",
    ],
)

java_library(
    name = "required_fields_checker",
    srcs = [
        "RequiredFieldsChecker.java",
    ],
    visibility = ["//visibility:private"],
    deps = [
        "//:auto_value",
        "@maven//:com_google_guava_guava",
    ],
)
